let {addShop,getMerchant,updateShop,deleteShop} = require('../dao/shopDao');

// 新增门店
module.exports.addShop = async (shop) => {
    let data = await addShop(shop);
    if(data._id){
        return data
    }
    return data
}
// 获取门店
module.exports.getMerchant = async (merchant) => {
    let data = await getMerchant(merchant);
    if(data.length > 0){
        return data
    }
    return false
}
// 修改门店
module.exports.updateShop = async (shop) => {
    let data = await updateShop(shop);
    if(data.ok){
        return true
    }
    return false
}
// 删除门店
module.exports.deleteShop = async (merchant) => {
    let data = await deleteShop(merchant);
    if(data.deletedCount){
        return true
    }
    return false
}